<template>
  <div style="height: 100%; display: flex; flex-direction: column;">
    <router-link to="add">添加数据</router-link>
    <el-row>
      <el-col>
        <el-select v-model="pid" placeholder="请选择部位">
          <el-option :value="0">全部</el-option>
          <el-option
            v-for="item in place"
            :key="item.id"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-col>
      <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1">
        <el-select v-model="did" placeholder="请选择掉落位置">
          <el-option :value="0">全部</el-option>
          <el-option
            v-for="item in dropaddr"
            :key="item.id"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-col>
        <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1">
        <el-select v-model="cid" placeholder="请选择类别">
          <el-option :value="0">全部</el-option>
          <el-option
            v-for="item in equipclass"
            :key="item.id"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-col>
    </el-row>
  </div>
</template>

<script>

export default {
  name: 'find',
  data () {
    return {
      pid:'',
      cid:'',
      did:'',
      place:[],
      dropaddr:[],
      equipclass:[]

    }
  },
  watch:{
    placeid:(val,oldval)=> {
      console.log(val)
    }
  },
  computed: {

  },
  methods: {
    getChoose(){

      //fetch('/api/getplace').then()
      this.$ajax.get(this.$tourl.getplace).then((response)=>{

        this.place=response.data.data
        console.log(response.data.data)
      })
      this.$ajax.get(this.$tourl.getdropaddr).then((response)=>{

        this.dropaddr=response.data.data
        console.log(response.data.data)
      })
      this.$ajax.get(this.$tourl.getequipclass).then((response)=>{

        this.equipclass=response.data.data
        console.log(response.data.data)
      })

    }
  },
  mounted () {
      this.getChoose()
  }
}
</script>

<style>

</style>
